package com.dragon.flow.enm.flowable;

/**
 * @title: 异步操作流程类型
 * @author: bruce.liu
 * @since: 2024/9/15 22:59
 */
public enum AsynMessageType {

    COMPLETE_TASK("completeTask", "任务审批"),
    START_PROCESS("start_process", "启动流程");
    private String code;
    private String name;

    AsynMessageType(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static AsynMessageType getByCode(String code) {
        for (AsynMessageType e : AsynMessageType.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }
}
